#!/usr/bin/env node

const fs = require('fs');
const file = process.argv[2];
let count = 1;
/*
if(!fs.existsSync(file)){
  console.error(`${file} not exit!`);
  return;
}*/
try{
  fs.readFile(file,'utf8',(err,data) => {
    if(err) {
      console.error(err.message);
      return;
    }
    const lines = data.split('\n');
    for(let i = 1 ; i < lines.length ; i++){
      console.log(`${i}\t${lines[i-1]}`);
    }
  });
}catch(e) {
  console.error(e.message);
}
/*process.on('uncaughtException',(e)=>{
  console.error(e.message);
})*/
